package com.git.bds.mr.login.model.dto;

import com.git.bds.mr.login.valid.ValidGroup;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * @author 成大事
 * @since 2022/9/17 21:14
 */
@Getter
@Setter
public class LoginDTO implements Serializable {

    @NotNull
    @Pattern(regexp = "^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\\d{8}$",groups = ValidGroup.PubUser.class,message = "手机号有误！！！")
    @NotBlank(message = "账号不能为空",groups = ValidGroup.All.class)
    @ApiModelProperty("账号")
    private String account;

    @NotNull
    @NotBlank(message = "密码不能为空",groups = ValidGroup.All.class)
    @ApiModelProperty("密码")
    private String password;
}
